#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>

struct student
{
  char name[20];
  int age;
};

void* func(void*);

int main(int argc,char** agrv)
{
  pthread_t tid;
  int ret;
  struct student* stu;
  ret = pthread_create(&tid,NULL,func,NULL);
  
  pthread_join(tid,(void**)&stu);
  
  printf("%s,%d\n",stu->name,stu->age);
  pthread_exit((void*)0);
}

void* func(void* num)
{
 struct student* stu;
 stu = malloc(sizeof(struct student));
 strcpy(stu->name,"li si");
 stu->age = 1;
 return (void*)stu;
}
